﻿
@model IEnumerable<JustMVCTest.Models.PO>

@{
    ViewBag.Title = "Index";
}

<h2>Download Data to Excel file</h2>

<form name="pickform" method="link" onsubmit="return checkform()" action="@Url.Action("Edit","POsEdit")"> 
<input type="hidden" value="NOTHING" name= "Item"/>
         <script type="text/javascript">
             var i = 0;
        </script>
       
       @foreach (var item in Model)
    {

    <tr style="color:blue; background-color:White ">
        <td>
            <input onclick="valuefunction(@Html.DisplayFor(modelItem => item.Item))" value="@Html.DisplayFor(modelItem => item.PONumber)" type="radio" name="PONumber" />
                    <script type="text/javascript">
                        if (i == 0) {
                            i = 1;
                             document.getElementsByName("PONumber")[0].checked = true;
                            document.pickform.Item.value = @Html.DisplayFor(modelItem => item.Item);
                        }
                         </script>
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PONumber)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Item)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DeliveryDate)
        </td>
    </tr>
    }